package com.cn.dao;

import com.cn.entity.User;
import com.cn.util.DBUtil;

import java.sql.ResultSet;
import java.sql.SQLException;

public class Registerdao {
    static User user=null;
    static ResultSet rs=null;
    public static Boolean getRegisterUser(String name,String phone,String pwd) {
        String sql = "insert into user(name,phone,password) values(?,?,?)";
        Object[] obj = {name, phone, pwd};
        return DBUtil.update(sql, obj);
    }
    public static Boolean getRegisterUseraccount(String phone,int taocanid,String taocanName,int tonghua,double  balance,int  liuliang,int  message) {
        String sql = "insert into useraccount(userid,taocanid,taocanName,tonghua,balance,liuliang,message) values((select id from user where phone =?),?,?,?,?,?,?)";
        Object[] obj = {phone,taocanid,taocanName,tonghua,balance,liuliang,message};
        return DBUtil.update(sql, obj);
    }

}
